Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/user expiry #581

Merged
merged 5 commits into from
Jan 9, 2017
Merged

Feature/user expiry #581

merged 5 commits into from
Jan 9, 2017

Conversation

arichardet
Copy link
Contributor

Adds the ability to specify a user expiry when adding or modifying a user.

Copy link
Contributor

@rebeccaskinner rebeccaskinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a couple of minor nitpicks on the code. The only big thing is making a decision about whether or not we want to refactor to allow for a "never expires" option.

@@ -72,6 +73,12 @@ type Preparer struct {
// HomeDir must also be indicated if MoveDir is set to true.
MoveDir bool `hcl:"move_dir"`

// Expiry is the date on which the user account will be disabled. The date is
// specified in the format YYYY-MM-DD. If not specified, the default expiry
// date specified by the EXPIRE variable in /ect/default/useradd, or an empty
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo. Should be /etc/default/useradd

// specified in the format YYYY-MM-DD. If not specified, the default expiry
// date specified by the EXPIRE variable in /ect/default/useradd, or an empty
// string (no expiry) will be used by default.
Expiry time.Time `hcl:"expiry"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be *time.Time? Otherwise any other changes to a user will have the side effect of setting an expiry since we'll always be setting it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only set the expiry if it is specified in the hcl. There are checks in user.go (DiffAdd and DiffMod) for this.

@rebeccaskinner rebeccaskinner merged commit 5ef8135 into master Jan 9, 2017
@rebeccaskinner rebeccaskinner deleted the feature/user-expiry branch January 9, 2017 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants